package com.gcsj.controller;

import com.alibaba.fastjson.JSONObject;
import com.gcsj.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("/test")
public class HelloController {
    
    @GetMapping("/hello")
    @ResponseBody
    public String hello() {
        return "hello，不太聪明可达鸭";
    }

    @PostMapping("/login")
    @ResponseBody
    public JSONObject login(@RequestParam String nickname, @RequestParam String password) {
        JSONObject jsonObject = new JSONObject();

        jsonObject.put("code", "200");
        jsonObject.put("msg", "登入成功!");
        return jsonObject;
    }
}
